﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using RStein.PosterousReader.WP.ViewModels;
using RStein.Posterous.API;
using RStein.PosterousReader.WP.HostServices;
using System.Collections.ObjectModel;
using RStein.PosterousReader.WP.ViewModels.ViewObjects;
using System.Diagnostics;
using RStein.PosterousReader.WP.UI;

namespace RStein.PosterousReader.WP.Views
{
    public partial class PostsListView : PageBase

    {
        public PostsListView()
        {
                        
            InitializeComponent();
            
        }

        
        private void Add_Click(object sender, EventArgs e)
        {

          handleAddPost();
        }

      
                
        private void handleAddPost()
        {
          PostsListViewModel viewModel = getViewModel();
          viewModel.AddPostCommand.Execute(null);
          
        }        

        private PostsListViewModel getViewModel()
        {
          return DataContext as PostsListViewModel;
        }

    }
}